FROM  singulax/jdk:1.7
MAINTAINER   root   <root.db.root@gmail.com>



ENV    TOMCAT_MAJOR_VERSION 7
ENV    TOMCAT_MINOR_VERSION 7.0.55
ENV    CATALINA_HOME   /tomcat
ENV    TOMCAT_DOWNLOAD  https://archive.apache.org/dist/tomcat/tomcat-${TOMCAT_MAJOR_VERSION}/v${TOMCAT_MINOR_VERSION}/bin/apache-tomcat-${TOMCAT_MINOR_VERSION}.tar.gz

#Install   Tomcat
RUN   cd / &&  wget   ${TOMCAT_DOWNLOAD} && \
      tar zxf  apache-tomcat-*.tar.gz && \
      rm   -fr  apache-tomcat-*.tar.gz && \
      mv   apache-tomcat*   tomcat   && \
      rm  -fr  /tomcat/bin/catalina.sh 
ADD   catalina.sh   /tomcat/bin/catalina.sh

ADD   create_tomcat_admin_user.sh /create_tomcat_admin_user.sh
ADD   run.sh   /run.sh
RUN   chmod   +x  /*.sh

EXPOSE 8080
ENTRYPOINT ["/run.sh"]
